<article id="wikiArticle">
<div></div>
<p>ECMAScript 5.1, an older version of the standard upon which JavaScript is based, was approved in June 2011.</p>
<p>The JavaScript runtime used in the latest versions of Mozilla projects including both Firefox and Thunderbird has full support for ECMAScript 5.1 features. This article covers the features supported by different versions of Mozilla's JavaScript runtime.</p>
<h2 id="Supported_features">Supported features</h2>
<h3 id="Added_in_JavaScript_1.8.5_(Gecko_2_Firefox_4_and_later)">Added in JavaScript 1.8.5 (Gecko 2, Firefox 4 and later)</h3>
<p>Firefox 4 has full ECMAScript 5 support including the <code>Object.*</code> methods and strict mode. See <a href="/en-US/docs/Web/JavaScript/New_in_JavaScript/1.8.5" title="en/JavaScript/New_in_JavaScript/1.8.5">New in JavaScript 1.8.5</a>.</p>
<h3 id="Added_in_JavaScript_1.8.1_(Gecko_1.9.1_Firefox_3.5)">Added in JavaScript 1.8.1 (Gecko 1.9.1, Firefox 3.5)</h3>
<ul>
<li><a class="internal" href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON" title="En/Using native JSON">Native JSON</a> support</li>
<li><a class="internal" href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf" title="En/Core JavaScript 1.5 Reference/Global Objects/Object/GetPrototypeOf"><code>Object.getPrototypeOf()</code></a> method.</li>
<li><a class="internal" href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim" title="En/Core JavaScript 1.5 Reference/Global Objects/String/Trim"><code>String.trim()</code></a> method, which trims whitespace from both ends of the string.</li>
<li>Gecko 1.9.1.4 updated the implementation of <a href="/en-US/docs/Web/JavaScript/Guide/Using_native_JSON#Converting_objects_into_JSON" title="En/Using native JSON#Converting objects into JSON"><code>JSON.stringify()</code></a> to be compliant with ECMAScript 5.</li>
</ul>
<p>Improvements laid out by ECMAScript 5 have been made in the parsing algorithm that prevents evaluating XHTML as JavaScript code in certain circumstances.</p>
<h3 id="Added_in_JavaScript_1.6_(Gecko_1.8_Firefox_1.5)">Added in JavaScript 1.6 (Gecko 1.8, Firefox 1.5)</h3>
<p>New <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array"><code>Array</code></a> methods offering several improved methods for manipulating arrays -- have been part of JavaScript since<a href="/en-US/docs/Web/JavaScript/New_in_JavaScript/1.6"> JavaScript 1.6</a>. Now they've been standardized as part of ECMAScript 5.</p>
<h2 id="See_also">See also</h2>
<ul>
<li><a class="external" href="http://www.ecmascript.org/" rel="noopener" title="http://www.ecmascript.org/">ECMAScript web site</a></li>
<li><a class="external" href="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf" rel="noopener" title="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf">ECMAScript 5.1 specification</a></li>
<li>John Resig's post on <a class="external" href="http://ejohn.org/blog/objectgetprototypeof/" rel="noopener" title="http://ejohn.org/blog/objectgetprototypeof/">Object.getPrototypeOf</a></li>
<li>Michael J. Ryan's implementation of <a class="external" href="http://frugalcoder.us/post/2010/01/07/EcmaScript-5s-Date-Extensions.aspx" rel="noopener" title="http://frugalcoder.us/post/2010/01/07/EcmaScript-5s-Date-Extensions.aspx">ECMAScript5 Dates in JavaScript</a></li>
<li><a class="external" href="http://kangax.github.io/es5-compat-table/" rel="noopener" title="http://kangax.github.io/es5-compat-table/">ECMAScript 5 support across browsers</a></li>
</ul>
</article>